#include "coin.h"

CCoin::CCoin() : CMovable()
{}

CCoin::	CCoin(float X,float Y)
{
	reality = 10;
	pos_x = X+4;
	pos_y = Y;
	width = 8;
	height = 16;
	anim = 0;
	reality = 5;
}

CCoin::	~CCoin()
{

}

void CCoin::RenderFrame(LPDIRECT3DDEVICE9 d3ddv,int t)
{
	DWORD now = GetTickCount();
	if (now - last_time > 200)
	{
		anim=(anim+1) % 4;
		last_time = now;
	}
	SpriteHandlerIP->Begin(D3DXSPRITE_ALPHABLEND);
	ItemPic->Render(_BackBuffer,pos_x,pos_y,3,anim);
	SpriteHandlerIP->End();
}

void CCoin::Update(int t)
{

}

void CCoin::Touch(CObjects *obj)
{
	life = 0;

	obj->CoinGot ++;
	int ii = BeforeMove();
	obj->v_y += 0.1f;
}